package com.bestcem.xm.member.entity.pojo;

import com.bestcem.xm.member.entity.mysql.ImportRecordEntity;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

/**
 * 导入记录 实体类
 *
 * @author yf.wang <yf.wang@idiaoyan.com>
 * @version V1.0
 * @date 2021/7/20
 */

@Getter
@Setter
public class ImportRecordDo {

    private String id;

    private String orgId;

    private Integer memberType;

    private String fileName;

    private Integer receiveCount;

    private Integer successCount;

    private Integer failedCount;

    private Integer status;

    private String opUserId;

    private Date createdTime;

    private Date updatedTime;

    public static ImportRecordDo toDo(ImportRecordEntity entity) {
        if (entity == null) {
            return new ImportRecordDo();
        }
        ImportRecordDo importRecordDo = new ImportRecordDo();
        importRecordDo.setCreatedTime(entity.getCreatedTime());
        importRecordDo.setFailedCount(entity.getFailedCount());
        importRecordDo.setFileName(entity.getFileName());
        importRecordDo.setId(entity.getId());
        importRecordDo.setMemberType(entity.getMemberType());
        importRecordDo.setOpUserId(entity.getOpUserId());
        importRecordDo.setOrgId(entity.getOrgId());
        importRecordDo.setReceiveCount(entity.getReceiveCount());
        importRecordDo.setStatus(entity.getStatus());
        importRecordDo.setSuccessCount(entity.getSuccessCount());
        importRecordDo.setUpdatedTime(entity.getUpdatedTime());
        return importRecordDo;
    }

    public static ImportRecordEntity toEntity(ImportRecordDo recordDo) {
        if (recordDo == null) {
            return new ImportRecordEntity();
        }
        ImportRecordEntity recordEntity = new ImportRecordEntity();
        recordEntity.setCreatedTime(recordDo.getCreatedTime());
        recordEntity.setFailedCount(recordDo.getFailedCount());
        recordEntity.setFileName(recordDo.getFileName());
        recordEntity.setId(recordDo.getId());
        recordEntity.setMemberType(recordDo.getMemberType());
        recordEntity.setOpUserId(recordDo.getOpUserId());
        recordEntity.setOrgId(recordDo.getOrgId());
        recordEntity.setReceiveCount(recordDo.getReceiveCount());
        recordEntity.setStatus(recordDo.getStatus());
        recordEntity.setSuccessCount(recordDo.getSuccessCount());
        recordEntity.setUpdatedTime(recordDo.getUpdatedTime());
        return recordEntity;
    }
}
